#ifndef PROGRESSBAR_H
#define PROGRESSBAR_H

#include <atlctrls.h>

#include "UiInterfaces.h"

namespace TddGui
{

class ProgressBar : public CProgressBarCtrl, public ProgressNotification
{
public:
    void Init(HWND hwnd) { Attach(hwnd); }

private:
	virtual void Status(unsigned int numerator, unsigned int denominator, COLORREF color)
	{
		SetRange(0, denominator);
		SetPos(numerator);
		SetColor(color);
	}
	void SetColor(COLORREF color)
	{
		ATLASSERT(::IsWindow(m_hWnd));
		::SendMessage(m_hWnd, PBM_SETBARCOLOR, 0, color); // has no affect on "visual styles" (i.e., if I use a manifest on XP or Later)
	}
};

}
#endif
